package sy.model;

import java.beans.Transient;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonProperty;

@Entity
@Table(name = "app_comment", catalog = "ssh")
public class AppComment implements java.io.Serializable{
	private Integer id;
	private String title;
	private String content;
	private SysAccount sysAccount;
	private String category;
	private String repaireCode;
	
	@JsonProperty(value = "sysAccountName")
    private String sysAccountName;

	public AppComment() {
		super();
	}
	@Id
	@GeneratedValue
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	@Column(name = "title")
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	@Column(name = "content")
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "sysAccount")
	public SysAccount getSysAccount() {
		return sysAccount;
	}
	public void setSysAccount(SysAccount sysAccount) {
		this.sysAccount = sysAccount;
	}
	@Column(name = "category")
	public String getCategory() {
		return category;
	}
	public void setCategory(String category) {
		this.category = category;
	}
	@Column(name = "repaireCode")
	public String getRepaireCode() {
		return repaireCode;
	}
	public void setRepaireCode(String repaireCode) {
		this.repaireCode = repaireCode;
	}
	
	@Transient
	public String getSysAccountName() {
		return getSysAccount()!=null?getSysAccount().getName():"";
	}
	public void setSysAccountName(String sysAccountName) {
		this.sysAccountName = sysAccountName;
	}
	
}
